#include <QCoreApplication>
#include <QDebug>
#include "atclient.h"

int main(int argc, char *argv[])
{
    int i, interval = 10;

    QCoreApplication a(argc, argv);

    if(argc < 2)
    {
        qDebug() << "Usage: " << argv[0] << " <serial port> [<update interval (second)>]";
        return -1;
    }

    if(argc >= 3)
    {
        i = QString(argv[2]).toInt();
        if(i > 3)
        {
            interval = i;
        }
    }

    qDebug() << "Update interval:" << interval << "(s)";
    AtClient atClient(argv[1], interval);
    return a.exec();
}
